//===----------------------------------------------------------------------===//
//
// This source file is part of the Soto for AWS open source project
//
// Copyright (c) 2017-2024 the Soto project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Soto project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/soto-project/soto-codegenerator.
// DO NOT EDIT.

#if canImport(FoundationEssentials)
import FoundationEssentials
#else
import Foundation
#endif
@_spi(SotoInternal) import SotoCore

extension Budgets {
    // MARK: Enums

    public enum ActionStatus: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case executionFailure = "EXECUTION_FAILURE"
        case executionInProgress = "EXECUTION_IN_PROGRESS"
        case executionSuccess = "EXECUTION_SUCCESS"
        case pending = "PENDING"
        case resetFailure = "RESET_FAILURE"
        case resetInProgress = "RESET_IN_PROGRESS"
        case reverseFailure = "REVERSE_FAILURE"
        case reverseInProgress = "REVERSE_IN_PROGRESS"
        case reverseSuccess = "REVERSE_SUCCESS"
        case standby = "STANDBY"
        public var description: String { return self.rawValue }
    }

    public enum ActionSubType: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case stopEc2 = "STOP_EC2_INSTANCES"
        case stopRds = "STOP_RDS_INSTANCES"
        public var description: String { return self.rawValue }
    }

    public enum ActionType: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case iam = "APPLY_IAM_POLICY"
        case scp = "APPLY_SCP_POLICY"
        case ssm = "RUN_SSM_DOCUMENTS"
        public var description: String { return self.rawValue }
    }

    public enum ApprovalModel: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case auto = "AUTOMATIC"
        case manual = "MANUAL"
        public var description: String { return self.rawValue }
    }

    public enum AutoAdjustType: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case forecast = "FORECAST"
        case historical = "HISTORICAL"
        public var description: String { return self.rawValue }
    }

    public enum BudgetType: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case cost = "COST"
        case riCoverage = "RI_COVERAGE"
        case riUtilization = "RI_UTILIZATION"
        case spCoverage = "SAVINGS_PLANS_COVERAGE"
        case spUtilization = "SAVINGS_PLANS_UTILIZATION"
        case usage = "USAGE"
        public var description: String { return self.rawValue }
    }

    public enum ComparisonOperator: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case equalTo = "EQUAL_TO"
        case greaterThan = "GREATER_THAN"
        case lessThan = "LESS_THAN"
        public var description: String { return self.rawValue }
    }

    public enum Dimension: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case az = "AZ"
        case billingEntity = "BILLING_ENTITY"
        case cacheEngine = "CACHE_ENGINE"
        case costCategoryName = "COST_CATEGORY_NAME"
        case databaseEngine = "DATABASE_ENGINE"
        case deploymentOption = "DEPLOYMENT_OPTION"
        case instanceType = "INSTANCE_TYPE"
        case instanceTypeFamily = "INSTANCE_TYPE_FAMILY"
        case invoicingEntity = "INVOICING_ENTITY"
        case legalEntityName = "LEGAL_ENTITY_NAME"
        case linkedAccount = "LINKED_ACCOUNT"
        case linkedAccountName = "LINKED_ACCOUNT_NAME"
        case operatingSystem = "OPERATING_SYSTEM"
        case operation = "OPERATION"
        case paymentOption = "PAYMENT_OPTION"
        case platform = "PLATFORM"
        case purchaseType = "PURCHASE_TYPE"
        case recordType = "RECORD_TYPE"
        case region = "REGION"
        case reservationId = "RESERVATION_ID"
        case reservationModified = "RESERVATION_MODIFIED"
        case resourceId = "RESOURCE_ID"
        case rightsizingType = "RIGHTSIZING_TYPE"
        case savingsPlanArn = "SAVINGS_PLAN_ARN"
        case savingsPlansType = "SAVINGS_PLANS_TYPE"
        case scope = "SCOPE"
        case service = "SERVICE"
        case serviceCode = "SERVICE_CODE"
        case subscriptionId = "SUBSCRIPTION_ID"
        case tagKey = "TAG_KEY"
        case tenancy = "TENANCY"
        case usageType = "USAGE_TYPE"
        case usageTypeGroup = "USAGE_TYPE_GROUP"
        public var description: String { return self.rawValue }
    }

    public enum EventType: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case createAction = "CREATE_ACTION"
        case deleteAction = "DELETE_ACTION"
        case executeAction = "EXECUTE_ACTION"
        case system = "SYSTEM"
        case updateAction = "UPDATE_ACTION"
        public var description: String { return self.rawValue }
    }

    public enum ExecutionType: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case approveBudgetAction = "APPROVE_BUDGET_ACTION"
        case resetBudgetAction = "RESET_BUDGET_ACTION"
        case retryBudgetAction = "RETRY_BUDGET_ACTION"
        case reverseBudgetAction = "REVERSE_BUDGET_ACTION"
        public var description: String { return self.rawValue }
    }

    public enum HealthStatusReason: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case billingViewNoAccess = "BILLING_VIEW_NO_ACCESS"
        case billingViewUnhealthy = "BILLING_VIEW_UNHEALTHY"
        case filterInvalid = "FILTER_INVALID"
        case multiYearHistoricalDataDisabled = "MULTI_YEAR_HISTORICAL_DATA_DISABLED"
        public var description: String { return self.rawValue }
    }

    public enum HealthStatusValue: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case healthy = "HEALTHY"
        case unhealthy = "UNHEALTHY"
        public var description: String { return self.rawValue }
    }

    public enum MatchOption: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case absent = "ABSENT"
        case caseInsensitive = "CASE_INSENSITIVE"
        case caseSensitive = "CASE_SENSITIVE"
        case contains = "CONTAINS"
        case endsWith = "ENDS_WITH"
        case equals = "EQUALS"
        case greaterThanOrEqual = "GREATER_THAN_OR_EQUAL"
        case startsWith = "STARTS_WITH"
        public var description: String { return self.rawValue }
    }

    public enum Metric: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case amortizedCost = "AmortizedCost"
        case blendedCost = "BlendedCost"
        case hours = "Hours"
        case netAmortizedCost = "NetAmortizedCost"
        case netUnblendedCost = "NetUnblendedCost"
        case normalizedUsageAmount = "NormalizedUsageAmount"
        case unblendedCost = "UnblendedCost"
        case usageQuantity = "UsageQuantity"
        public var description: String { return self.rawValue }
    }

    public enum NotificationState: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case alarm = "ALARM"
        case ok = "OK"
        public var description: String { return self.rawValue }
    }

    public enum NotificationType: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case actual = "ACTUAL"
        case forecasted = "FORECASTED"
        public var description: String { return self.rawValue }
    }

    public enum SubscriptionType: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case email = "EMAIL"
        case sns = "SNS"
        public var description: String { return self.rawValue }
    }

    public enum ThresholdType: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case absoluteValue = "ABSOLUTE_VALUE"
        case percentage = "PERCENTAGE"
        public var description: String { return self.rawValue }
    }

    public enum TimeUnit: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case annually = "ANNUALLY"
        case custom = "CUSTOM"
        case daily = "DAILY"
        case monthly = "MONTHLY"
        case quarterly = "QUARTERLY"
        public var description: String { return self.rawValue }
    }

    // MARK: Shapes

    public struct Action: AWSDecodableShape {
        /// A system-generated universally unique identifier (UUID) for the action.
        public let actionId: String
        /// The trigger threshold of the action.
        public let actionThreshold: ActionThreshold
        /// The type of action. This defines the type of tasks that can be carried out by this
        /// 			action. This field also determines the format for definition.
        public let actionType: ActionType
        /// This specifies if the action needs manual or automatic approval.
        public let approvalModel: ApprovalModel
        public let budgetName: String
        /// Where you specify all of the type-specific parameters.
        public let definition: Definition
        /// The role passed for action execution and reversion. Roles and actions must be in the
        /// 			same account.
        public let executionRoleArn: String
        public let notificationType: NotificationType
        /// The status of the action.
        public let status: ActionStatus
        public let subscribers: [Subscriber]

        @inlinable
        public init(actionId: String, actionThreshold: ActionThreshold, actionType: ActionType, approvalModel: ApprovalModel, budgetName: String, definition: Definition, executionRoleArn: String, notificationType: NotificationType, status: ActionStatus, subscribers: [Subscriber]) {
            self.actionId = actionId
            self.actionThreshold = actionThreshold
            self.actionType = actionType
            self.approvalModel = approvalModel
            self.budgetName = budgetName
            self.definition = definition
            self.executionRoleArn = executionRoleArn
            self.notificationType = notificationType
            self.status = status
            self.subscribers = subscribers
        }

        private enum CodingKeys: String, CodingKey {
            case actionId = "ActionId"
            case actionThreshold = "ActionThreshold"
            case actionType = "ActionType"
            case approvalModel = "ApprovalModel"
            case budgetName = "BudgetName"
            case definition = "Definition"
            case executionRoleArn = "ExecutionRoleArn"
            case notificationType = "NotificationType"
            case status = "Status"
            case subscribers = "Subscribers"
        }
    }

    public struct ActionHistory: AWSDecodableShape {
        /// The description of the details for the event.
        public let actionHistoryDetails: ActionHistoryDetails
        /// This distinguishes between whether the events are triggered by the user or are
        /// 			generated by the system.
        public let eventType: EventType
        /// The status of action at the time of the event.
        public let status: ActionStatus
        public let timestamp: Date

        @inlinable
        public init(actionHistoryDetails: ActionHistoryDetails, eventType: EventType, status: ActionStatus, timestamp: Date) {
            self.actionHistoryDetails = actionHistoryDetails
            self.eventType = eventType
            self.status = status
            self.timestamp = timestamp
        }

        private enum CodingKeys: String, CodingKey {
            case actionHistoryDetails = "ActionHistoryDetails"
            case eventType = "EventType"
            case status = "Status"
            case timestamp = "Timestamp"
        }
    }

    public struct ActionHistoryDetails: AWSDecodableShape {
        /// The budget action resource.
        public let action: Action
        public let message: String

        @inlinable
        public init(action: Action, message: String) {
            self.action = action
            self.message = message
        }

        private enum CodingKeys: String, CodingKey {
            case action = "Action"
            case message = "Message"
        }
    }

    public struct ActionThreshold: AWSEncodableShape & AWSDecodableShape {
        public let actionThresholdType: ThresholdType
        public let actionThresholdValue: Double

        @inlinable
        public init(actionThresholdType: ThresholdType, actionThresholdValue: Double) {
            self.actionThresholdType = actionThresholdType
            self.actionThresholdValue = actionThresholdValue
        }

        public func validate(name: String) throws {
            try self.validate(self.actionThresholdValue, name: "actionThresholdValue", parent: name, max: 15000000000000.0)
            try self.validate(self.actionThresholdValue, name: "actionThresholdValue", parent: name, min: 0.0)
        }

        private enum CodingKeys: String, CodingKey {
            case actionThresholdType = "ActionThresholdType"
            case actionThresholdValue = "ActionThresholdValue"
        }
    }

    public struct AutoAdjustData: AWSEncodableShape & AWSDecodableShape {
        /// The string that defines whether your budget auto-adjusts based on historical or
        /// 			forecasted data.
        public let autoAdjustType: AutoAdjustType
        /// The parameters that define or describe the historical data that your auto-adjusting
        /// 			budget is based on.
        public let historicalOptions: HistoricalOptions?
        /// The last time that your budget was auto-adjusted.
        public let lastAutoAdjustTime: Date?

        @inlinable
        public init(autoAdjustType: AutoAdjustType, historicalOptions: HistoricalOptions? = nil, lastAutoAdjustTime: Date? = nil) {
            self.autoAdjustType = autoAdjustType
            self.historicalOptions = historicalOptions
            self.lastAutoAdjustTime = lastAutoAdjustTime
        }

        public func validate(name: String) throws {
            try self.historicalOptions?.validate(name: "\(name).historicalOptions")
        }

        private enum CodingKeys: String, CodingKey {
            case autoAdjustType = "AutoAdjustType"
            case historicalOptions = "HistoricalOptions"
            case lastAutoAdjustTime = "LastAutoAdjustTime"
        }
    }

    public struct Budget: AWSEncodableShape & AWSDecodableShape {
        /// The parameters that determine the budget amount for an auto-adjusting budget.
        public let autoAdjustData: AutoAdjustData?
        /// The Amazon Resource Name (ARN) that uniquely identifies a specific billing view. The ARN is
        /// 			used to specify which particular billing view you want to interact with or retrieve
        /// 			information from when making API calls related to Amazon Web Services Billing and Cost
        /// 			Management features. The BillingViewArn can be retrieved by calling the ListBillingViews
        /// 			API.
        public let billingViewArn: String?
        /// The total amount of cost, usage, RI utilization, RI coverage, Savings Plans
        /// 			utilization, or Savings Plans coverage that you want to track with your budget.  BudgetLimit is required for cost or usage budgets, but optional for RI or
        /// 			Savings Plans utilization or coverage budgets. RI and Savings Plans utilization or
        /// 			coverage budgets default to 100. This is the only valid value for RI or
        /// 			Savings Plans utilization or coverage budgets. You can't use BudgetLimit
        /// 			with PlannedBudgetLimits for CreateBudget and
        /// 				UpdateBudget actions.
        public let budgetLimit: Spend?
        /// The name of a budget. The name must be unique within an account. The :
        /// 			and \ characters, and the "/action/" substring, aren't allowed in
        /// 				BudgetName.
        public let budgetName: String
        /// Specifies whether this budget tracks costs, usage, RI utilization, RI coverage,
        /// 			Savings Plans utilization, or Savings Plans coverage.
        public let budgetType: BudgetType
        /// The actual and forecasted cost or usage that the budget tracks.
        public let calculatedSpend: CalculatedSpend?
        /// The cost filters, such as Region, Service,
        /// 				LinkedAccount, Tag, or CostCategory, that are
        /// 			applied to a budget. Amazon Web Services Budgets supports the following services as a Service filter for RI budgets:   Amazon EC2   Amazon Redshift   Amazon Relational Database Service   Amazon ElastiCache   Amazon OpenSearch Service
        public let costFilters: [String: [String]]?
        /// The types of costs that are included in this COST budget.  USAGE, RI_UTILIZATION, RI_COVERAGE,
        /// 				SAVINGS_PLANS_UTILIZATION, and SAVINGS_PLANS_COVERAGE
        /// 			budgets do not have CostTypes.
        public let costTypes: CostTypes?
        /// The filtering dimensions for the budget and their corresponding values.
        public let filterExpression: Expression?
        /// The current operational state of a Billing View derived resource.
        public let healthStatus: HealthStatus?
        /// The last time that you updated this budget.
        public let lastUpdatedTime: Date?
        /// The definition for how the budget data is aggregated.
        public let metrics: [Metric]?
        /// A map containing multiple BudgetLimit, including current or future
        /// 			limits.  PlannedBudgetLimits is available for cost or usage budget and supports
        /// 			both monthly and quarterly TimeUnit.  For monthly budgets, provide 12 months of PlannedBudgetLimits values.
        /// 			This must start from the current month and include the next 11 months. The
        /// 				key is the start of the month, UTC in epoch seconds.  For quarterly budgets, provide four quarters of PlannedBudgetLimits value
        /// 			entries in standard calendar quarter increments. This must start from the current
        /// 			quarter and include the next three quarters. The key is the start of the
        /// 			quarter, UTC in epoch seconds.  If the planned budget expires before 12 months for monthly or four quarters for
        /// 			quarterly, provide the PlannedBudgetLimits values only for the remaining
        /// 			periods. If the budget begins at a date in the future, provide PlannedBudgetLimits
        /// 			values from the start date of the budget.  After all of the BudgetLimit values in PlannedBudgetLimits
        /// 			are used, the budget continues to use the last limit as the BudgetLimit. At
        /// 			that point, the planned budget provides the same experience as a fixed budget.   DescribeBudget and DescribeBudgets response along with
        /// 				PlannedBudgetLimits also contain BudgetLimit representing
        /// 			the current month or quarter limit present in PlannedBudgetLimits. This
        /// 			only applies to budgets that are created with PlannedBudgetLimits. Budgets
        /// 			that are created without PlannedBudgetLimits only contain
        /// 				BudgetLimit. They don't contain
        /// 			PlannedBudgetLimits.
        public let plannedBudgetLimits: [String: Spend]?
        /// The period of time that's covered by a budget. You set the start date and end date. The
        /// 			start date must come before the end date. The end date must come before 06/15/87
        /// 				00:00 UTC.  If you create your budget and don't specify a start date, Amazon Web Services defaults
        /// 			to the start of your chosen time period (DAILY, MONTHLY, QUARTERLY, ANNUALLY, or CUSTOM). For
        /// 			example, if you created your budget on January 24, 2018, chose DAILY, and
        /// 			didn't set a start date, Amazon Web Services set your start date to 01/24/18 00:00
        /// 				UTC. If you chose MONTHLY, Amazon Web Services set your start
        /// 			date to 01/01/18 00:00 UTC. If you didn't specify an end date, Amazon Web Services set your end date to 06/15/87 00:00 UTC. The defaults are
        /// 			the same for the Billing and Cost Management console and the API.  You can change either date with the UpdateBudget operation. After the end date, Amazon Web Services deletes the budget and all the associated
        /// 			notifications and subscribers.
        public let timePeriod: TimePeriod?
        /// The length of time until a budget resets the actual and forecasted spend.
        public let timeUnit: TimeUnit

        @inlinable
        public init(autoAdjustData: AutoAdjustData? = nil, billingViewArn: String? = nil, budgetLimit: Spend? = nil, budgetName: String, budgetType: BudgetType, calculatedSpend: CalculatedSpend? = nil, filterExpression: Expression? = nil, healthStatus: HealthStatus? = nil, lastUpdatedTime: Date? = nil, metrics: [Metric]? = nil, plannedBudgetLimits: [String: Spend]? = nil, timePeriod: TimePeriod? = nil, timeUnit: TimeUnit) {
            self.autoAdjustData = autoAdjustData
            self.billingViewArn = billingViewArn
            self.budgetLimit = budgetLimit
            self.budgetName = budgetName
            self.budgetType = budgetType
            self.calculatedSpend = calculatedSpend
            self.costFilters = nil
            self.costTypes = nil
            self.filterExpression = filterExpression
            self.healthStatus = healthStatus
            self.lastUpdatedTime = lastUpdatedTime
            self.metrics = metrics
            self.plannedBudgetLimits = plannedBudgetLimits
            self.timePeriod = timePeriod
            self.timeUnit = timeUnit
        }

        @available(*, deprecated, message: "Members costFilters, costTypes have been deprecated")
        @inlinable
        public init(autoAdjustData: AutoAdjustData? = nil, billingViewArn: String? = nil, budgetLimit: Spend? = nil, budgetName: String, budgetType: BudgetType, calculatedSpend: CalculatedSpend? = nil, costFilters: [String: [String]]? = nil, costTypes: CostTypes? = nil, filterExpression: Expression? = nil, healthStatus: HealthStatus? = nil, lastUpdatedTime: Date? = nil, metrics: [Metric]? = nil, plannedBudgetLimits: [String: Spend]? = nil, timePeriod: TimePeriod? = nil, timeUnit: TimeUnit) {
            self.autoAdjustData = autoAdjustData
            self.billingViewArn = billingViewArn
            self.budgetLimit = budgetLimit
            self.budgetName = budgetName
            self.budgetType = budgetType
            self.calculatedSpend = calculatedSpend
            self.costFilters = costFilters
            self.costTypes = costTypes
            self.filterExpression = filterExpression
            self.healthStatus = healthStatus
            self.lastUpdatedTime = lastUpdatedTime
            self.metrics = metrics
            self.plannedBudgetLimits = plannedBudgetLimits
            self.timePeriod = timePeriod
            self.timeUnit = timeUnit
        }

        public func validate(name: String) throws {
            try self.autoAdjustData?.validate(name: "\(name).autoAdjustData")
            try self.validate(self.billingViewArn, name: "billingViewArn", parent: name, max: 2048)
            try self.validate(self.billingViewArn, name: "billingViewArn", parent: name, min: 20)
            try self.validate(self.billingViewArn, name: "billingViewArn", parent: name, pattern: "^arn:aws[a-z-]*:(billing)::[0-9]{12}:billingview/[a-zA-Z0-9/:_\\+=\\.\\-@]{0,75}[a-zA-Z0-9]$")
            try self.budgetLimit?.validate(name: "\(name).budgetLimit")
            try self.validate(self.budgetName, name: "budgetName", parent: name, max: 100)
            try self.validate(self.budgetName, name: "budgetName", parent: name, min: 1)
            try self.validate(self.budgetName, name: "budgetName", parent: name, pattern: "^(?![^:\\\\]*/action/|(?i).*<script>.*</script>.*)[^:\\\\]+$")
            try self.calculatedSpend?.validate(name: "\(name).calculatedSpend")
            try self.costFilters?.forEach {
                try validate($0.key, name: "costFilters.key", parent: name, max: 2147483647)
                try validate($0.key, name: "costFilters.key", parent: name, pattern: ".*")
            }
            try self.filterExpression?.validate(name: "\(name).filterExpression")
            try self.validate(self.metrics, name: "metrics", parent: name, max: 1)
            try self.plannedBudgetLimits?.forEach {
                try validate($0.key, name: "plannedBudgetLimits.key", parent: name, max: 2147483647)
                try validate($0.key, name: "plannedBudgetLimits.key", parent: name, pattern: ".*")
                try $0.value.validate(name: "\(name).plannedBudgetLimits[\"\($0.key)\"]")
            }
        }

        private enum CodingKeys: String, CodingKey {
            case autoAdjustData = "AutoAdjustData"
            case billingViewArn = "BillingViewArn"
            case budgetLimit = "BudgetLimit"
            case budgetName = "BudgetName"
            case budgetType = "BudgetType"
            case calculatedSpend = "CalculatedSpend"
            case costFilters = "CostFilters"
            case costTypes = "CostTypes"
            case filterExpression = "FilterExpression"
            case healthStatus = "HealthStatus"
            case lastUpdatedTime = "LastUpdatedTime"
            case metrics = "Metrics"
            case plannedBudgetLimits = "PlannedBudgetLimits"
            case timePeriod = "TimePeriod"
            case timeUnit = "TimeUnit"
        }
    }

    public struct BudgetNotificationsForAccount: AWSDecodableShape {
        public let budgetName: String?
        public let notifications: [Notification]?

        @inlinable
        public init(budgetName: String? = nil, notifications: [Notification]? = nil) {
            self.budgetName = budgetName
            self.notifications = notifications
        }

        private enum CodingKeys: String, CodingKey {
            case budgetName = "BudgetName"
            case notifications = "Notifications"
        }
    }

    public struct BudgetPerformanceHistory: AWSDecodableShape {
        /// The Amazon Resource Name (ARN) that uniquely identifies a specific billing view. The ARN is
        /// 			used to specify which particular billing view you want to interact with or retrieve
        /// 			information from when making API calls related to Amazon Web Services Billing and Cost
        /// 			Management features. The BillingViewArn can be retrieved by calling the ListBillingViews
        /// 			API.
        public let billingViewArn: String?
        /// A list of amounts of cost or usage that you created budgets for, which are compared to
        /// 			your actual costs or usage.
        public let budgetedAndActualAmountsList: [BudgetedAndActualAmounts]?
        public let budgetName: String?
        public let budgetType: BudgetType?
        /// The history of the cost filters for a budget during the specified time period.
        public let costFilters: [String: [String]]?
        /// The history of the cost types for a budget during the specified time period.
        public let costTypes: CostTypes?
        public let timeUnit: TimeUnit?

        @inlinable
        public init(billingViewArn: String? = nil, budgetedAndActualAmountsList: [BudgetedAndActualAmounts]? = nil, budgetName: String? = nil, budgetType: BudgetType? = nil, costFilters: [String: [String]]? = nil, costTypes: CostTypes? = nil, timeUnit: TimeUnit? = nil) {
            self.billingViewArn = billingViewArn
            self.budgetedAndActualAmountsList = budgetedAndActualAmountsList
            self.budgetName = budgetName
            self.budgetType = budgetType
            self.costFilters = costFilters
            self.costTypes = costTypes
            self.timeUnit = timeUnit
        }

        private enum CodingKeys: String, CodingKey {
            case billingViewArn = "BillingViewArn"
            case budgetedAndActualAmountsList = "BudgetedAndActualAmountsList"
            case budgetName = "BudgetName"
            case budgetType = "BudgetType"
            case costFilters = "CostFilters"
            case costTypes = "CostTypes"
            case timeUnit = "TimeUnit"
        }
    }

    public struct BudgetedAndActualAmounts: AWSDecodableShape {
        /// Your actual costs or usage for a budget period.
        public let actualAmount: Spend?
        /// The amount of cost or usage that you created the budget for.
        public let budgetedAmount: Spend?
        /// The time period that's covered by this budget comparison.
        public let timePeriod: TimePeriod?

        @inlinable
        public init(actualAmount: Spend? = nil, budgetedAmount: Spend? = nil, timePeriod: TimePeriod? = nil) {
            self.actualAmount = actualAmount
            self.budgetedAmount = budgetedAmount
            self.timePeriod = timePeriod
        }

        private enum CodingKeys: String, CodingKey {
            case actualAmount = "ActualAmount"
            case budgetedAmount = "BudgetedAmount"
            case timePeriod = "TimePeriod"
        }
    }

    public struct CalculatedSpend: AWSEncodableShape & AWSDecodableShape {
        /// The amount of cost, usage, RI units, or Savings Plans units that you used.
        public let actualSpend: Spend
        /// The amount of cost, usage, RI units, or Savings Plans units that you're forecasted to
        /// 			use.
        public let forecastedSpend: Spend?

        @inlinable
        public init(actualSpend: Spend, forecastedSpend: Spend? = nil) {
            self.actualSpend = actualSpend
            self.forecastedSpend = forecastedSpend
        }

        public func validate(name: String) throws {
            try self.actualSpend.validate(name: "\(name).actualSpend")
            try self.forecastedSpend?.validate(name: "\(name).forecastedSpend")
        }

        private enum CodingKeys: String, CodingKey {
            case actualSpend = "ActualSpend"
            case forecastedSpend = "ForecastedSpend"
        }
    }

    public struct CostCategoryValues: AWSEncodableShape & AWSDecodableShape {
        /// The unique name of the cost category.
        public let key: String?
        /// The match options that you can use to filter your results.
        public let matchOptions: [MatchOption]?
        /// The specific value of the cost category.
        public let values: [String]?

        @inlinable
        public init(key: String? = nil, matchOptions: [MatchOption]? = nil, values: [String]? = nil) {
            self.key = key
            self.matchOptions = matchOptions
            self.values = values
        }

        public func validate(name: String) throws {
            try self.values?.forEach {
                try validate($0, name: "values[]", parent: name, max: 1024)
                try validate($0, name: "values[]", parent: name, pattern: "^[\\S\\s]*$")
            }
            try self.validate(self.values, name: "values", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case key = "Key"
            case matchOptions = "MatchOptions"
            case values = "Values"
        }
    }

    public struct CostTypes: AWSEncodableShape & AWSDecodableShape {
        /// Specifies whether a budget includes credits. The default value is true.
        public let includeCredit: Bool?
        /// Specifies whether a budget includes discounts. The default value is true.
        public let includeDiscount: Bool?
        /// Specifies whether a budget includes non-RI subscription costs. The default value is true.
        public let includeOtherSubscription: Bool?
        /// Specifies whether a budget includes recurring fees such as monthly RI fees. The default value is true.
        public let includeRecurring: Bool?
        /// Specifies whether a budget includes refunds. The default value is true.
        public let includeRefund: Bool?
        /// Specifies whether a budget includes subscriptions. The default value is true.
        public let includeSubscription: Bool?
        /// Specifies whether a budget includes support subscription fees. The default value is true.
        public let includeSupport: Bool?
        /// Specifies whether a budget includes taxes. The default value is true.
        public let includeTax: Bool?
        /// Specifies whether a budget includes upfront RI costs. The default value is true.
        public let includeUpfront: Bool?
        /// Specifies whether a budget uses the amortized rate. The default value is false.
        public let useAmortized: Bool?
        /// Specifies whether a budget uses a blended rate. The default value is false.
        public let useBlended: Bool?

        @inlinable
        public init(includeCredit: Bool? = nil, includeDiscount: Bool? = nil, includeOtherSubscription: Bool? = nil, includeRecurring: Bool? = nil, includeRefund: Bool? = nil, includeSubscription: Bool? = nil, includeSupport: Bool? = nil, includeTax: Bool? = nil, includeUpfront: Bool? = nil, useAmortized: Bool? = nil, useBlended: Bool? = nil) {
            self.includeCredit = includeCredit
            self.includeDiscount = includeDiscount
            self.includeOtherSubscription = includeOtherSubscription
            self.includeRecurring = includeRecurring
            self.includeRefund = includeRefund
            self.includeSubscription = includeSubscription
            self.includeSupport = includeSupport
            self.includeTax = includeTax
            self.includeUpfront = includeUpfront
            self.useAmortized = useAmortized
            self.useBlended = useBlended
        }

        private enum CodingKeys: String, CodingKey {
            case includeCredit = "IncludeCredit"
            case includeDiscount = "IncludeDiscount"
            case includeOtherSubscription = "IncludeOtherSubscription"
            case includeRecurring = "IncludeRecurring"
            case includeRefund = "IncludeRefund"
            case includeSubscription = "IncludeSubscription"
            case includeSupport = "IncludeSupport"
            case includeTax = "IncludeTax"
            case includeUpfront = "IncludeUpfront"
            case useAmortized = "UseAmortized"
            case useBlended = "UseBlended"
        }
    }

    public struct CreateBudgetActionRequest: AWSEncodableShape {
        public let accountId: String
        public let actionThreshold: ActionThreshold
        ///  The type of action. This defines the type of tasks that can be carried out by this action. This field also determines the format for definition.
        public let actionType: ActionType
        ///  This specifies if the action needs manual or automatic approval.
        public let approvalModel: ApprovalModel
        public let budgetName: String
        public let definition: Definition
        ///  The role passed for action execution and reversion. Roles and actions must be in the same account.
        public let executionRoleArn: String
        public let notificationType: NotificationType
        /// An optional list of tags to associate with the specified budget action. Each tag consists of a key and a value, and each key must be unique for the resource.
        public let resourceTags: [ResourceTag]?
        public let subscribers: [Subscriber]

        @inlinable
        public init(accountId: String, actionThreshold: ActionThreshold, actionType: ActionType, approvalModel: ApprovalModel, budgetName: String, definition: Definition, executionRoleArn: String, notificationType: NotificationType, resourceTags: [ResourceTag]? = nil, subscribers: [Subscriber]) {
            self.accountId = accountId
            self.actionThreshold = actionThreshold
            self.actionType = actionType
            self.approvalModel = approvalModel
            self.budgetName = budgetName
            self.definition = definition
            self.executionRoleArn = executionRoleArn
            self.notificationType = notificationType
            self.resourceTags = resourceTags
            self.subscribers = subscribers
        }

        public func validate(name: String) throws {
            try self.validate(self.accountId, name: "accountId", parent: name, max: 12)
            try self.validate(self.accountId, name: "accountId", parent: name, min: 12)
            try self.validate(self.accountId, name: "accountId", parent: name, pattern: "^\\d{12}$")
            try self.actionThreshold.validate(name: "\(name).actionThreshold")
            try self.validate(self.budgetName, name: "budgetName", parent: name, max: 100)
            try self.validate(self.budgetName, name: "budgetName", parent: name, min: 1)
            try self.validate(self.budgetName, name: "budgetName", parent: name, pattern: "^(?![^:\\\\]*/action/|(?i).*<script>.*</script>.*)[^:\\\\]+$")
            try self.definition.validate(name: "\(name).definition")
            try self.validate(self.executionRoleArn, name: "executionRoleArn", parent: name, max: 618)
            try self.validate(self.executionRoleArn, name: "executionRoleArn", parent: name, min: 32)
            try self.validate(self.executionRoleArn, name: "executionRoleArn", parent: name, pattern: "^arn:aws(-cn|-us-gov|-iso|-iso-[a-z]{1})?:iam::\\d{12}:role(\\u002F[\\u0021-\\u007F]+\\u002F|\\u002F)[\\w+=,.@-]+$")
            try self.resourceTags?.forEach {
                try $0.validate(name: "\(name).resourceTags[]")
            }
            try self.validate(self.resourceTags, name: "resourceTags", parent: name, max: 200)
            try self.subscribers.forEach {
                try $0.validate(name: "\(name).subscribers[]")
            }
            try self.validate(self.subscribers, name: "subscribers", parent: name, max: 11)
            try self.validate(self.subscribers, name: "subscribers", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case accountId = "AccountId"
            case actionThreshold = "ActionThreshold"
            case actionType = "ActionType"
            case approvalModel = "ApprovalModel"
            case budgetName = "BudgetName"
            case definition = "Definition"
            case executionRoleArn = "ExecutionRoleArn"
            case notificationType = "NotificationType"
            case resourceTags = "ResourceTags"
            case subscribers = "Subscribers"
        }
    }

    public struct CreateBudgetActionResponse: AWSDecodableShape {
        public let accountId: String
        ///  A system-generated universally unique identifier (UUID) for the action.
        public let actionId: String
        public let budgetName: String

        @inlinable
        public init(accountId: String, actionId: String, budgetName: String) {
            self.accountId = accountId
            self.actionId = actionId
            self.budgetName = budgetName
        }

        private enum CodingKeys: String, CodingKey {
            case accountId = "AccountId"
            case actionId = "ActionId"
            case budgetName = "BudgetName"
        }
    }

    public struct CreateBudgetRequest: AWSEncodableShape {
        /// The accountId that is associated with the budget.
        public let accountId: String
        /// The budget object that you want to create.
        public let budget: Budget
        /// A notification that you want to associate with a budget. A budget can have up to five notifications, and each notification can have one SNS subscriber and up to 10 email subscribers. If you include notifications and subscribers in your CreateBudget call, Amazon Web Services creates the notifications and subscribers for you.
        public let notificationsWithSubscribers: [NotificationWithSubscribers]?
        /// An optional list of tags to associate with the specified budget. Each tag consists of a key and a value, and each key must be unique for the resource.
        public let resourceTags: [ResourceTag]?

        @inlinable
        public init(accountId: String, budget: Budget, notificationsWithSubscribers: [NotificationWithSubscribers]? = nil, resourceTags: [ResourceTag]? = nil) {
            self.accountId = accountId
            self.budget = budget
            self.notificationsWithSubscribers = notificationsWithSubscribers
            self.resourceTags = resourceTags
        }

        public func validate(name: String) throws {
            try self.validate(self.accountId, name: "accountId", parent: name, max: 12)
            try self.validate(self.accountId, name: "accountId", parent: name, min: 12)
            try self.validate(self.accountId, name: "accountId", parent: name, pattern: "^\\d{12}$")
            try self.budget.validate(name: "\(name).budget")
            try self.notificationsWithSubscribers?.forEach {
                try $0.validate(name: "\(name).notificationsWithSubscribers[]")
            }
            try self.validate(self.notificationsWithSubscribers, name: "notificationsWithSubscribers", parent: name, max: 10)
            try self.resourceTags?.forEach {
                try $0.validate(name: "\(name).resourceTags[]")
            }
            try self.validate(self.resourceTags, name: "resourceTags", parent: name, max: 200)
        }

        private enum CodingKeys: String, CodingKey {
            case accountId = "AccountId"
            case budget = "Budget"
            case notificationsWithSubscribers = "NotificationsWithSubscribers"
            case resourceTags = "ResourceTags"
        }
    }

    public struct CreateBudgetResponse: AWSDecodableShape {
        public init() {}
    }

    public struct CreateNotificationRequest: AWSEncodableShape {
        /// The accountId that is associated with the budget that you want to create a notification for.
        public let accountId: String
        /// The name of the budget that you want Amazon Web Services to notify you about. Budget names must be unique within an account.
        public let budgetName: String
        /// The notification that you want to create.
        public let notification: Notification
        /// A list of subscribers that you want to associate with the notification. Each notification can have one SNS subscriber and up to 10 email subscribers.
        public let subscribers: [Subscriber]

        @inlinable
        public init(accountId: String, budgetName: String, notification: Notification, subscribers: [Subscriber]) {
            self.accountId = accountId
            self.budgetName = budgetName
            self.notification = notification
            self.subscribers = subscribers
        }

        public func validate(name: String) throws {
            try self.validate(self.accountId, name: "accountId", parent: name, max: 12)
            try self.validate(self.accountId, name: "accountId", parent: name, min: 12)
            try self.validate(self.accountId, name: "accountId", parent: name, pattern: "^\\d{12}$")
            try self.validate(self.budgetName, name: "budgetName", parent: name, max: 100)
            try self.validate(self.budgetName, name: "budgetName", parent: name, min: 1)
            try self.validate(self.budgetName, name: "budgetName", parent: name, pattern: "^(?![^:\\\\]*/action/|(?i).*<script>.*</script>.*)[^:\\\\]+$")
            try self.notification.validate(name: "\(name).notification")
            try self.subscribers.forEach {
                try $0.validate(name: "\(name).subscribers[]")
            }
            try self.validate(self.subscribers, name: "subscribers", parent: name, max: 11)
            try self.validate(self.subscribers, name: "subscribers", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case accountId = "AccountId"
            case budgetName = "BudgetName"
            case notification = "Notification"
            case subscribers = "Subscribers"
        }
    }

    public struct CreateNotificationResponse: AWSDecodableShape {
        public init() {}
    }

    public struct CreateSubscriberRequest: AWSEncodableShape {
        /// The accountId that is associated with the budget that you want to create a subscriber for.
        public let accountId: String
        /// The name of the budget that you want to subscribe to. Budget names must be unique within an account.
        public let budgetName: String
        /// The notification that you want to create a subscriber for.
        public let notification: Notification
        /// The subscriber that you want to associate with a budget notification.
        public let subscriber: Subscriber

        @inlinable
        public init(accountId: String, budgetName: String, notification: Notification, subscriber: Subscriber) {
            self.accountId = accountId
            self.budgetName = budgetName
            self.notification = notification
            self.subscriber = subscriber
        }

        public func validate(name: String) throws {
            try self.validate(self.accountId, name: "accountId", parent: name, max: 12)
            try self.validate(self.accountId, name: "accountId", parent: name, min: 12)
            try self.validate(self.accountId, name: "accountId", parent: name, pattern: "^\\d{12}$")
            try self.validate(self.budgetName, name: "budgetName", parent: name, max: 100)
            try self.validate(self.budgetName, name: "budgetName", parent: name, min: 1)
            try self.validate(self.budgetName, name: "budgetName", parent: name, pattern: "^(?![^:\\\\]*/action/|(?i).*<script>.*</script>.*)[^:\\\\]+$")
            try self.notification.validate(name: "\(name).notification")
            try self.subscriber.validate(name: "\(name).subscriber")
        }

        private enum CodingKeys: String, CodingKey {
            case accountId = "AccountId"
            case budgetName = "BudgetName"
            case notification = "Notification"
            case subscriber = "Subscriber"
        }
    }

    public struct CreateSubscriberResponse: AWSDecodableShape {
        public init() {}
    }

    public struct Definition: AWSEncodableShape & AWSDecodableShape {
        /// The Identity and Access Management (IAM) action definition details.
        public let iamActionDefinition: IamActionDefinition?
        /// The service control policies (SCPs) action definition details.
        public let scpActionDefinition: ScpActionDefinition?
        /// The Amazon Web Services Systems Manager (SSM) action definition details.
        public let ssmActionDefinition: SsmActionDefinition?

        @inlinable
        public init(iamActionDefinition: IamActionDefinition? = nil, scpActionDefinition: ScpActionDefinition? = nil, ssmActionDefinition: SsmActionDefinition? = nil) {
            self.iamActionDefinition = iamActionDefinition
            self.scpActionDefinition = scpActionDefinition
            self.ssmActionDefinition = ssmActionDefinition
        }

        public func validate(name: String) throws {
            try self.iamActionDefinition?.validate(name: "\(name).iamActionDefinition")
            try self.scpActionDefinition?.validate(name: "\(name).scpActionDefinition")
            try self.ssmActionDefinition?.validate(name: "\(name).ssmActionDefinition")
        }

        private enum CodingKeys: String, CodingKey {
            case iamActionDefinition = "IamActionDefinition"
            case scpActionDefinition = "ScpActionDefinition"
            case ssmActionDefinition = "SsmActionDefinition"
        }
    }

    public struct DeleteBudgetActionRequest: AWSEncodableShape {
        public let accountId: String
        ///  A system-generated universally unique identifier (UUID) for the action.
        public let actionId: String
        public let budgetName: String

        @inlinable
        public init(accountId: String, actionId: String, budgetName: String) {
            self.accountId = accountId
            self.actionId = actionId
            self.budgetName = budgetName
        }

        public func validate(name: String) throws {
            try self.validate(self.accountId, name: "accountId", parent: name, max: 12)
            try self.validate(self.accountId, name: "accountId", parent: name, min: 12)
            try self.validate(self.accountId, name: "accountId", parent: name, pattern: "^\\d{12}$")
            try self.validate(self.actionId, name: "actionId", parent: name, max: 36)
            try self.validate(self.actionId, name: "actionId", parent: name, min: 36)
            try self.validate(self.actionId, name: "actionId", parent: name, pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$")
            try self.validate(self.budgetName, name: "budgetName", parent: name, max: 100)
            try self.validate(self.budgetName, name: "budgetName", parent: name, min: 1)
            try self.validate(self.budgetName, name: "budgetName", parent: name, pattern: "^(?![^:\\\\]*/action/|(?i).*<script>.*</script>.*)[^:\\\\]+$")
        }

        private enum CodingKeys: String, CodingKey {
            case accountId = "AccountId"
            case actionId = "ActionId"
            case budgetName = "BudgetName"
        }
    }

    public struct DeleteBudgetActionResponse: AWSDecodableShape {
        public let accountId: String
        public let action: Action
        public let budgetName: String

        @inlinable
        public init(accountId: String, action: Action, budgetName: String) {
            self.accountId = accountId
            self.action = action
            self.budgetName = budgetName
        }

        private enum CodingKeys: String, CodingKey {
            case accountId = "AccountId"
            case action = "Action"
            case budgetName = "BudgetName"
        }
    }

    public struct DeleteBudgetRequest: AWSEncodableShape {
        /// The accountId that is associated with the budget that you want to delete.
        public let accountId: String
        /// The name of the budget that you want to delete.
        public let budgetName: String

        @inlinable
        public init(accountId: String, budgetName: String) {
            self.accountId = accountId
            self.budgetName = budgetName
        }

        public func validate(name: String) throws {
            try self.validate(self.accountId, name: "accountId", parent: name, max: 12)
            try self.validate(self.accountId, name: "accountId", parent: name, min: 12)
            try self.validate(self.accountId, name: "accountId", parent: name, pattern: "^\\d{12}$")
            try self.validate(self.budgetName, name: "budgetName", parent: name, max: 100)
            try self.validate(self.budgetName, name: "budgetName", parent: name, min: 1)
            try self.validate(self.budgetName, name: "budgetName", parent: name, pattern: "^(?![^:\\\\]*/action/|(?i).*<script>.*</script>.*)[^:\\\\]+$")
        }

        private enum CodingKeys: String, CodingKey {
            case accountId = "AccountId"
            case budgetName = "BudgetName"
        }
    }

    public struct DeleteBudgetResponse: AWSDecodableShape {
        public init() {}
    }

    public struct DeleteNotificationRequest: AWSEncodableShape {
        /// The accountId that is associated with the budget whose notification you want to delete.
        public let accountId: String
        /// The name of the budget whose notification you want to delete.
        public let budgetName: String
        /// The notification that you want to delete.
        public let notification: Notification

        @inlinable
        public init(accountId: String, budgetName: String, notification: Notification) {
            self.accountId = accountId
            self.budgetName = budgetName
            self.notification = notification
        }

        public func validate(name: String) throws {
            try self.validate(self.accountId, name: "accountId", parent: name, max: 12)
            try self.validate(self.accountId, name: "accountId", parent: name, min: 12)
            try self.validate(self.accountId, name: "accountId", parent: name, pattern: "^\\d{12}$")
            try self.validate(self.budgetName, name: "budgetName", parent: name, max: 100)
            try self.validate(self.budgetName, name: "budgetName", parent: name, min: 1)
            try self.validate(self.budgetName, name: "budgetName", parent: name, pattern: "^(?![^:\\\\]*/action/|(?i).*<script>.*</script>.*)[^:\\\\]+$")
            try self.notification.validate(name: "\(name).notification")
        }

        private enum CodingKeys: String, CodingKey {
            case accountId = "AccountId"
            case budgetName = "BudgetName"
            case notification = "Notification"
        }
    }

    public struct DeleteNotificationResponse: AWSDecodableShape {
        public init() {}
    }

    public struct DeleteSubscriberRequest: AWSEncodableShape {
        /// The accountId that is associated with the budget whose subscriber you want to delete.
        public let accountId: String
        /// The name of the budget whose subscriber you want to delete.
        public let budgetName: String
        /// The notification whose subscriber you want to delete.
        public let notification: Notification
        /// The subscriber that you want to delete.
        public let subscriber: Subscriber

        @inlinable
        public init(accountId: String, budgetName: String, notification: Notification, subscriber: Subscriber) {
            self.accountId = accountId
            self.budgetName = budgetName
            self.notification = notification
            self.subscriber = subscriber
        }

        public func validate(name: String) throws {
            try self.validate(self.accountId, name: "accountId", parent: name, max: 12)
            try self.validate(self.accountId, name: "accountId", parent: name, min: 12)
            try self.validate(self.accountId, name: "accountId", parent: name, pattern: "^\\d{12}$")
            try self.validate(self.budgetName, name: "budgetName", parent: name, max: 100)
            try self.validate(self.budgetName, name: "budgetName", parent: name, min: 1)
            try self.validate(self.budgetName, name: "budgetName", parent: name, pattern: "^(?![^:\\\\]*/action/|(?i).*<script>.*</script>.*)[^:\\\\]+$")
            try self.notification.validate(name: "\(name).notification")
            try self.subscriber.validate(name: "\(name).subscriber")
        }

        private enum CodingKeys: String, CodingKey {
            case accountId = "AccountId"
            case budgetName = "BudgetName"
            case notification = "Notification"
            case subscriber = "Subscriber"
        }
    }

    public struct DeleteSubscriberResponse: AWSDecodableShape {
        public init() {}
    }

    public struct DescribeBudgetActionHistoriesRequest: AWSEncodableShape {
        public let accountId: String
        ///  A system-generated universally unique identifier (UUID) for the action.
        public let actionId: String
        public let budgetName: String
        public let maxResults: Int?
        public let nextToken: String?
        public let timePeriod: TimePeriod?

        @inlinable
        public init(accountId: String, actionId: String, budgetName: String, maxResults: Int? = nil, nextToken: String? = nil, timePeriod: TimePeriod? = nil) {
            self.accountId = accountId
            self.actionId = actionId
            self.budgetName = budgetName
            self.maxResults = maxResults
            self.nextToken = nextToken
            self.timePeriod = timePeriod
        }

        public func validate(name: String) throws {
            try self.validate(self.accountId, name: "accountId", parent: name, max: 12)
            try self.validate(self.accountId, name: "accountId", parent: name, min: 12)
            try self.validate(self.accountId, name: "accountId", parent: name, pattern: "^\\d{12}$")
            try self.validate(self.actionId, name: "actionId", parent: name, max: 36)
            try self.validate(self.actionId, name: "actionId", parent: name, min: 36)
            try self.validate(self.actionId, name: "actionId", parent: name, pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$")
            try self.validate(self.budgetName, name: "budgetName", parent: name, max: 100)
            try self.validate(self.budgetName, name: "budgetName", parent: name, min: 1)
            try self.validate(self.budgetName, name: "budgetName", parent: name, pattern: "^(?![^:\\\\]*/action/|(?i).*<script>.*</script>.*)[^:\\\\]+$")
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 100)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 2147483647)
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: ".*")
        }

        private enum CodingKeys: String, CodingKey {
            case accountId = "AccountId"
            case actionId = "ActionId"
            case budgetName = "BudgetName"
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
            case timePeriod = "TimePeriod"
        }
    }

    public struct DescribeBudgetActionHistoriesResponse: AWSDecodableShape {
        ///  The historical record of the budget action resource.
        public let actionHistories: [ActionHistory]
        public let nextToken: String?

        @inlinable
        public init(actionHistories: [ActionHistory], nextToken: String? = nil) {
            self.actionHistories = actionHistories
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case actionHistories = "ActionHistories"
            case nextToken = "NextToken"
        }
    }

    public struct DescribeBudgetActionRequest: AWSEncodableShape {
        public let accountId: String
        ///  A system-generated universally unique identifier (UUID) for the action.
        public let actionId: String
        public let budgetName: String

        @inlinable
        public init(accountId: String, actionId: String, budgetName: String) {
            self.accountId = accountId
            self.actionId = actionId
            self.budgetName = budgetName
        }

        public func validate(name: String) throws {
            try self.validate(self.accountId, name: "accountId", parent: name, max: 12)
            try self.validate(self.accountId, name: "accountId", parent: name, min: 12)
            try self.validate(self.accountId, name: "accountId", parent: name, pattern: "^\\d{12}$")
            try self.validate(self.actionId, name: "actionId", parent: name, max: 36)
            try self.validate(self.actionId, name: "actionId", parent: name, min: 36)
            try self.validate(self.actionId, name: "actionId", parent: name, pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$")
            try self.validate(self.budgetName, name: "budgetName", parent: name, max: 100)
            try self.validate(self.budgetName, name: "budgetName", parent: name, min: 1)
            try self.validate(self.budgetName, name: "budgetName", parent: name, pattern: "^(?![^:\\\\]*/action/|(?i).*<script>.*</script>.*)[^:\\\\]+$")
        }

        private enum CodingKeys: String, CodingKey {
            case accountId = "AccountId"
            case actionId = "ActionId"
            case budgetName = "BudgetName"
        }
    }

    public struct DescribeBudgetActionResponse: AWSDecodableShape {
        public let accountId: String
        ///  A budget action resource.
        public let action: Action
        public let budgetName: String

        @inlinable
        public init(accountId: String, action: Action, budgetName: String) {
            self.accountId = accountId
            self.action = action
            self.budgetName = budgetName
        }

        private enum CodingKeys: String, CodingKey {
            case accountId = "AccountId"
            case action = "Action"
            case budgetName = "BudgetName"
        }
    }

    public struct DescribeBudgetActionsForAccountRequest: AWSEncodableShape {
        public let accountId: String
        public let maxResults: Int?
        public let nextToken: String?

        @inlinable
        public init(accountId: String, maxResults: Int? = nil, nextToken: String? = nil) {
            self.accountId = accountId
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.accountId, name: "accountId", parent: name, max: 12)
            try self.validate(self.accountId, name: "accountId", parent: name, min: 12)
            try self.validate(self.accountId, name: "accountId", parent: name, pattern: "^\\d{12}$")
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 100)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 2147483647)
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: ".*")
        }

        private enum CodingKeys: String, CodingKey {
            case accountId = "AccountId"
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
        }
    }

    public struct DescribeBudgetActionsForAccountResponse: AWSDecodableShape {
        ///  A list of the budget action resources information.
        public let actions: [Action]
        public let nextToken: String?

        @inlinable
        public init(actions: [Action], nextToken: String? = nil) {
            self.actions = actions
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case actions = "Actions"
            case nextToken = "NextToken"
        }
    }

    public struct DescribeBudgetActionsForBudgetRequest: AWSEncodableShape {
        public let accountId: String
        public let budgetName: String
        public let maxResults: Int?
        public let nextToken: String?

        @inlinable
        public init(accountId: String, budgetName: String, maxResults: Int? = nil, nextToken: String? = nil) {
            self.accountId = accountId
            self.budgetName = budgetName
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.accountId, name: "accountId", parent: name, max: 12)
            try self.validate(self.accountId, name: "accountId", parent: name, min: 12)
            try self.validate(self.accountId, name: "accountId", parent: name, pattern: "^\\d{12}$")
            try self.validate(self.budgetName, name: "budgetName", parent: name, max: 100)
            try self.validate(self.budgetName, name: "budgetName", parent: name, min: 1)
            try self.validate(self.budgetName, name: "budgetName", parent: name, pattern: "^(?![^:\\\\]*/action/|(?i).*<script>.*</script>.*)[^:\\\\]+$")
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 100)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 2147483647)
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: ".*")
        }

        private enum CodingKeys: String, CodingKey {
            case accountId = "AccountId"
            case budgetName = "BudgetName"
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
        }
    }

    public struct DescribeBudgetActionsForBudgetResponse: AWSDecodableShape {
        ///  A list of the budget action resources information.
        public let actions: [Action]
        public let nextToken: String?

        @inlinable
        public init(actions: [Action], nextToken: String? = nil) {
            self.actions = actions
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case actions = "Actions"
            case nextToken = "NextToken"
        }
    }

    public struct DescribeBudgetNotificationsForAccountRequest: AWSEncodableShape {
        public let accountId: String
        ///  An integer that represents how many budgets a paginated response contains. The
        /// 			default is 50.
        public let maxResults: Int?
        public let nextToken: String?

        @inlinable
        public init(accountId: String, maxResults: Int? = nil, nextToken: String? = nil) {
            self.accountId = accountId
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.accountId, name: "accountId", parent: name, max: 12)
            try self.validate(self.accountId, name: "accountId", parent: name, min: 12)
            try self.validate(self.accountId, name: "accountId", parent: name, pattern: "^\\d{12}$")
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 1000)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 2147483647)
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: ".*")
        }

        private enum CodingKeys: String, CodingKey {
            case accountId = "AccountId"
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
        }
    }

    public struct DescribeBudgetNotificationsForAccountResponse: AWSDecodableShape {
        ///  A list of budget names and associated notifications for an account.
        public let budgetNotificationsForAccount: [BudgetNotificationsForAccount]?
        public let nextToken: String?

        @inlinable
        public init(budgetNotificationsForAccount: [BudgetNotificationsForAccount]? = nil, nextToken: String? = nil) {
            self.budgetNotificationsForAccount = budgetNotificationsForAccount
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case budgetNotificationsForAccount = "BudgetNotificationsForAccount"
            case nextToken = "NextToken"
        }
    }

    public struct DescribeBudgetPerformanceHistoryRequest: AWSEncodableShape {
        public let accountId: String
        public let budgetName: String
        public let maxResults: Int?
        public let nextToken: String?
        /// Retrieves how often the budget went into an ALARM state for the specified time period.
        public let timePeriod: TimePeriod?

        @inlinable
        public init(accountId: String, budgetName: String, maxResults: Int? = nil, nextToken: String? = nil, timePeriod: TimePeriod? = nil) {
            self.accountId = accountId
            self.budgetName = budgetName
            self.maxResults = maxResults
            self.nextToken = nextToken
            self.timePeriod = timePeriod
        }

        public func validate(name: String) throws {
            try self.validate(self.accountId, name: "accountId", parent: name, max: 12)
            try self.validate(self.accountId, name: "accountId", parent: name, min: 12)
            try self.validate(self.accountId, name: "accountId", parent: name, pattern: "^\\d{12}$")
            try self.validate(self.budgetName, name: "budgetName", parent: name, max: 100)
            try self.validate(self.budgetName, name: "budgetName", parent: name, min: 1)
            try self.validate(self.budgetName, name: "budgetName", parent: name, pattern: "^(?![^:\\\\]*/action/|(?i).*<script>.*</script>.*)[^:\\\\]+$")
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 100)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 2147483647)
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: ".*")
        }

        private enum CodingKeys: String, CodingKey {
            case accountId = "AccountId"
            case budgetName = "BudgetName"
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
            case timePeriod = "TimePeriod"
        }
    }

    public struct DescribeBudgetPerformanceHistoryResponse: AWSDecodableShape {
        /// The history of how often the budget has gone into an ALARM state. For DAILY budgets, the history saves the state of the budget for the last 60 days. For MONTHLY budgets, the history saves the state of the budget for the current month plus the last 12 months. For QUARTERLY budgets, the history saves the state of the budget for the last four quarters.
        public let budgetPerformanceHistory: BudgetPerformanceHistory?
        public let nextToken: String?

        @inlinable
        public init(budgetPerformanceHistory: BudgetPerformanceHistory? = nil, nextToken: String? = nil) {
            self.budgetPerformanceHistory = budgetPerformanceHistory
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case budgetPerformanceHistory = "BudgetPerformanceHistory"
            case nextToken = "NextToken"
        }
    }

    public struct DescribeBudgetRequest: AWSEncodableShape {
        /// The accountId that is associated with the budget that you want a description of.
        public let accountId: String
        /// The name of the budget that you want a description of.
        public let budgetName: String
        /// Specifies whether the response includes the filter expression associated with the budget. By showing the filter expression, you can see detailed filtering logic applied to the budget, such as Amazon Web Services services or tags that are being tracked.
        public let showFilterExpression: Bool?

        @inlinable
        public init(accountId: String, budgetName: String, showFilterExpression: Bool? = nil) {
            self.accountId = accountId
            self.budgetName = budgetName
            self.showFilterExpression = showFilterExpression
        }

        public func validate(name: String) throws {
            try self.validate(self.accountId, name: "accountId", parent: name, max: 12)
            try self.validate(self.accountId, name: "accountId", parent: name, min: 12)
            try self.validate(self.accountId, name: "accountId", parent: name, pattern: "^\\d{12}$")
            try self.validate(self.budgetName, name: "budgetName", parent: name, max: 100)
            try self.validate(self.budgetName, name: "budgetName", parent: name, min: 1)
            try self.validate(self.budgetName, name: "budgetName", parent: name, pattern: "^(?![^:\\\\]*/action/|(?i).*<script>.*</script>.*)[^:\\\\]+$")
        }

        private enum CodingKeys: String, CodingKey {
            case accountId = "AccountId"
            case budgetName = "BudgetName"
            case showFilterExpression = "ShowFilterExpression"
        }
    }

    public struct DescribeBudgetResponse: AWSDecodableShape {
        /// The description of the budget.
        public let budget: Budget?

        @inlinable
        public init(budget: Budget? = nil) {
            self.budget = budget
        }

        private enum CodingKeys: String, CodingKey {
            case budget = "Budget"
        }
    }

    public struct DescribeBudgetsRequest: AWSEncodableShape {
        /// The accountId that is associated with the budgets that you want to describe.
        public let accountId: String
        /// An integer that represents how many budgets a paginated response contains. The default is 100.
        public let maxResults: Int?
        /// The pagination token that you include in your request to indicate the next set of results that you want to retrieve.
        public let nextToken: String?
        /// Specifies whether the response includes the filter expression associated with the budgets. By showing the filter expression, you can see detailed filtering logic applied to the budgets, such as Amazon Web Services services or tags that are being tracked.
        public let showFilterExpression: Bool?

        @inlinable
        public init(accountId: String, maxResults: Int? = nil, nextToken: String? = nil, showFilterExpression: Bool? = nil) {
            self.accountId = accountId
            self.maxResults = maxResults
            self.nextToken = nextToken
            self.showFilterExpression = showFilterExpression
        }

        public func validate(name: String) throws {
            try self.validate(self.accountId, name: "accountId", parent: name, max: 12)
            try self.validate(self.accountId, name: "accountId", parent: name, min: 12)
            try self.validate(self.accountId, name: "accountId", parent: name, pattern: "^\\d{12}$")
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 1000)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 2147483647)
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: ".*")
        }

        private enum CodingKeys: String, CodingKey {
            case accountId = "AccountId"
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
            case showFilterExpression = "ShowFilterExpression"
        }
    }

    public struct DescribeBudgetsResponse: AWSDecodableShape {
        /// A list of budgets.
        public let budgets: [Budget]?
        /// The pagination token in the service response that indicates the next set of results that you can retrieve.
        public let nextToken: String?

        @inlinable
        public init(budgets: [Budget]? = nil, nextToken: String? = nil) {
            self.budgets = budgets
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case budgets = "Budgets"
            case nextToken = "NextToken"
        }
    }

    public struct DescribeNotificationsForBudgetRequest: AWSEncodableShape {
        /// The accountId that is associated with the budget whose notifications you want descriptions of.
        public let accountId: String
        /// The name of the budget whose notifications you want descriptions of.
        public let budgetName: String
        /// An optional integer that represents how many entries a paginated response contains.
        public let maxResults: Int?
        /// The pagination token that you include in your request to indicate the next set of results that you want to retrieve.
        public let nextToken: String?

        @inlinable
        public init(accountId: String, budgetName: String, maxResults: Int? = nil, nextToken: String? = nil) {
            self.accountId = accountId
            self.budgetName = budgetName
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.accountId, name: "accountId", parent: name, max: 12)
            try self.validate(self.accountId, name: "accountId", parent: name, min: 12)
            try self.validate(self.accountId, name: "accountId", parent: name, pattern: "^\\d{12}$")
            try self.validate(self.budgetName, name: "budgetName", parent: name, max: 100)
            try self.validate(self.budgetName, name: "budgetName", parent: name, min: 1)
            try self.validate(self.budgetName, name: "budgetName", parent: name, pattern: "^(?![^:\\\\]*/action/|(?i).*<script>.*</script>.*)[^:\\\\]+$")
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 100)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 2147483647)
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: ".*")
        }

        private enum CodingKeys: String, CodingKey {
            case accountId = "AccountId"
            case budgetName = "BudgetName"
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
        }
    }

    public struct DescribeNotificationsForBudgetResponse: AWSDecodableShape {
        /// The pagination token in the service response that indicates the next set of results that you can retrieve.
        public let nextToken: String?
        /// A list of notifications that are associated with a budget.
        public let notifications: [Notification]?

        @inlinable
        public init(nextToken: String? = nil, notifications: [Notification]? = nil) {
            self.nextToken = nextToken
            self.notifications = notifications
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case notifications = "Notifications"
        }
    }

    public struct DescribeSubscribersForNotificationRequest: AWSEncodableShape {
        /// The accountId that is associated with the budget whose subscribers you want descriptions of.
        public let accountId: String
        /// The name of the budget whose subscribers you want descriptions of.
        public let budgetName: String
        /// An optional integer that represents how many entries a paginated response contains.
        public let maxResults: Int?
        /// The pagination token that you include in your request to indicate the next set of results that you want to retrieve.
        public let nextToken: String?
        /// The notification whose subscribers you want to list.
        public let notification: Notification

        @inlinable
        public init(accountId: String, budgetName: String, maxResults: Int? = nil, nextToken: String? = nil, notification: Notification) {
            self.accountId = accountId
            self.budgetName = budgetName
            self.maxResults = maxResults
            self.nextToken = nextToken
            self.notification = notification
        }

        public func validate(name: String) throws {
            try self.validate(self.accountId, name: "accountId", parent: name, max: 12)
            try self.validate(self.accountId, name: "accountId", parent: name, min: 12)
            try self.validate(self.accountId, name: "accountId", parent: name, pattern: "^\\d{12}$")
            try self.validate(self.budgetName, name: "budgetName", parent: name, max: 100)
            try self.validate(self.budgetName, name: "budgetName", parent: name, min: 1)
            try self.validate(self.budgetName, name: "budgetName", parent: name, pattern: "^(?![^:\\\\]*/action/|(?i).*<script>.*</script>.*)[^:\\\\]+$")
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 100)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 2147483647)
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: ".*")
            try self.notification.validate(name: "\(name).notification")
        }

        private enum CodingKeys: String, CodingKey {
            case accountId = "AccountId"
            case budgetName = "BudgetName"
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
            case notification = "Notification"
        }
    }

    public struct DescribeSubscribersForNotificationResponse: AWSDecodableShape {
        /// The pagination token in the service response that indicates the next set of results that you can retrieve.
        public let nextToken: String?
        /// A list of subscribers that are associated with a notification.
        public let subscribers: [Subscriber]?

        @inlinable
        public init(nextToken: String? = nil, subscribers: [Subscriber]? = nil) {
            self.nextToken = nextToken
            self.subscribers = subscribers
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case subscribers = "Subscribers"
        }
    }

    public struct ExecuteBudgetActionRequest: AWSEncodableShape {
        public let accountId: String
        ///  A system-generated universally unique identifier (UUID) for the action.
        public let actionId: String
        public let budgetName: String
        ///  The type of execution.
        public let executionType: ExecutionType

        @inlinable
        public init(accountId: String, actionId: String, budgetName: String, executionType: ExecutionType) {
            self.accountId = accountId
            self.actionId = actionId
            self.budgetName = budgetName
            self.executionType = executionType
        }

        public func validate(name: String) throws {
            try self.validate(self.accountId, name: "accountId", parent: name, max: 12)
            try self.validate(self.accountId, name: "accountId", parent: name, min: 12)
            try self.validate(self.accountId, name: "accountId", parent: name, pattern: "^\\d{12}$")
            try self.validate(self.actionId, name: "actionId", parent: name, max: 36)
            try self.validate(self.actionId, name: "actionId", parent: name, min: 36)
            try self.validate(self.actionId, name: "actionId", parent: name, pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$")
            try self.validate(self.budgetName, name: "budgetName", parent: name, max: 100)
            try self.validate(self.budgetName, name: "budgetName", parent: name, min: 1)
            try self.validate(self.budgetName, name: "budgetName", parent: name, pattern: "^(?![^:\\\\]*/action/|(?i).*<script>.*</script>.*)[^:\\\\]+$")
        }

        private enum CodingKeys: String, CodingKey {
            case accountId = "AccountId"
            case actionId = "ActionId"
            case budgetName = "BudgetName"
            case executionType = "ExecutionType"
        }
    }

    public struct ExecuteBudgetActionResponse: AWSDecodableShape {
        public let accountId: String
        ///  A system-generated universally unique identifier (UUID) for the action.
        public let actionId: String
        public let budgetName: String
        ///  The type of execution.
        public let executionType: ExecutionType

        @inlinable
        public init(accountId: String, actionId: String, budgetName: String, executionType: ExecutionType) {
            self.accountId = accountId
            self.actionId = actionId
            self.budgetName = budgetName
            self.executionType = executionType
        }

        private enum CodingKeys: String, CodingKey {
            case accountId = "AccountId"
            case actionId = "ActionId"
            case budgetName = "BudgetName"
            case executionType = "ExecutionType"
        }
    }

    public final class Expression: AWSEncodableShape & AWSDecodableShape {
        /// Return results that match both Dimension objects.
        public let and: [Expression]?
        /// The filter that's based on CostCategoryValues.
        public let costCategories: CostCategoryValues?
        /// The specific Dimension to use for Expression.
        public let dimensions: ExpressionDimensionValues?
        /// Return results that don't match a Dimension object.
        public let not: Expression?
        /// Return results that match either Dimension object.
        public let or: [Expression]?
        /// The specific Tag to use for Expression.
        public let tags: TagValues?

        @inlinable
        public init(and: [Expression]? = nil, costCategories: CostCategoryValues? = nil, dimensions: ExpressionDimensionValues? = nil, not: Expression? = nil, or: [Expression]? = nil, tags: TagValues? = nil) {
            self.and = and
            self.costCategories = costCategories
            self.dimensions = dimensions
            self.not = not
            self.or = or
            self.tags = tags
        }

        public func validate(name: String) throws {
            try self.and?.forEach {
                try $0.validate(name: "\(name).and[]")
            }
            try self.costCategories?.validate(name: "\(name).costCategories")
            try self.dimensions?.validate(name: "\(name).dimensions")
            try self.not?.validate(name: "\(name).not")
            try self.or?.forEach {
                try $0.validate(name: "\(name).or[]")
            }
            try self.tags?.validate(name: "\(name).tags")
        }

        private enum CodingKeys: String, CodingKey {
            case and = "And"
            case costCategories = "CostCategories"
            case dimensions = "Dimensions"
            case not = "Not"
            case or = "Or"
            case tags = "Tags"
        }
    }

    public struct ExpressionDimensionValues: AWSEncodableShape & AWSDecodableShape {
        /// The name of the dimension that you want to filter on.
        public let key: Dimension
        /// The match options that you can use to filter your results. You can specify only one of these
        /// 			values in the array.
        public let matchOptions: [MatchOption]?
        /// The metadata values you can specify to filter upon, so that the results all match at least
        /// 			one of the specified values.
        public let values: [String]

        @inlinable
        public init(key: Dimension, matchOptions: [MatchOption]? = nil, values: [String]) {
            self.key = key
            self.matchOptions = matchOptions
            self.values = values
        }

        public func validate(name: String) throws {
            try self.values.forEach {
                try validate($0, name: "values[]", parent: name, max: 1024)
                try validate($0, name: "values[]", parent: name, pattern: "^[\\S\\s]*$")
            }
            try self.validate(self.values, name: "values", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case key = "Key"
            case matchOptions = "MatchOptions"
            case values = "Values"
        }
    }

    public struct HealthStatus: AWSEncodableShape & AWSDecodableShape {
        public let lastUpdatedTime: Date?
        /// The current status of the billing view resource.
        public let status: HealthStatusValue?
        /// The reason for the current status.    BILLING_VIEW_NO_ACCESS: The billing view resource does not grant
        /// 						billing:GetBillingViewData permission to this account.    BILLING_VIEW_UNHEALTHY:  The billing view associated with the
        /// 					budget is unhealthy.    FILTER_INVALID: The filter contains reference to an account you
        /// 					do not have access to.    MULTI_YEAR_HISTORICAL_DATA_DISABLED: The budget is not being updated. Enable multi-year historical data in your Cost Management preferences.
        public let statusReason: HealthStatusReason?

        @inlinable
        public init(lastUpdatedTime: Date? = nil, status: HealthStatusValue? = nil, statusReason: HealthStatusReason? = nil) {
            self.lastUpdatedTime = lastUpdatedTime
            self.status = status
            self.statusReason = statusReason
        }

        private enum CodingKeys: String, CodingKey {
            case lastUpdatedTime = "LastUpdatedTime"
            case status = "Status"
            case statusReason = "StatusReason"
        }
    }

    public struct HistoricalOptions: AWSEncodableShape & AWSDecodableShape {
        /// The number of budget periods included in the moving-average calculation that
        /// 			determines your auto-adjusted budget amount. The maximum value depends on the
        /// 				TimeUnit granularity of the budget:   For the DAILY granularity, the maximum value is
        /// 					60.   For the MONTHLY granularity, the maximum value is
        /// 					12.   For the QUARTERLY granularity, the maximum value is
        /// 						4.   For the ANNUALLY granularity, the maximum value is
        /// 					1.
        public let budgetAdjustmentPeriod: Int
        /// The integer that describes how many budget periods in your
        /// 				BudgetAdjustmentPeriod are included in the calculation of your current
        /// 				BudgetLimit. If the first budget period in your
        /// 				BudgetAdjustmentPeriod has no cost data, then that budget period isn’t
        /// 			included in the average that determines your budget limit.  For example, if you set BudgetAdjustmentPeriod as 4
        /// 			quarters, but your account had no cost data in the first quarter, then only the last
        /// 			three quarters are included in the calculation. In this scenario,
        /// 				LookBackAvailablePeriods returns 3.  You can’t set your own LookBackAvailablePeriods. The value is
        /// 			automatically calculated from the BudgetAdjustmentPeriod and your
        /// 			historical cost data.
        public let lookBackAvailablePeriods: Int?

        @inlinable
        public init(budgetAdjustmentPeriod: Int, lookBackAvailablePeriods: Int? = nil) {
            self.budgetAdjustmentPeriod = budgetAdjustmentPeriod
            self.lookBackAvailablePeriods = lookBackAvailablePeriods
        }

        public func validate(name: String) throws {
            try self.validate(self.budgetAdjustmentPeriod, name: "budgetAdjustmentPeriod", parent: name, max: 60)
            try self.validate(self.budgetAdjustmentPeriod, name: "budgetAdjustmentPeriod", parent: name, min: 1)
            try self.validate(self.lookBackAvailablePeriods, name: "lookBackAvailablePeriods", parent: name, max: 60)
            try self.validate(self.lookBackAvailablePeriods, name: "lookBackAvailablePeriods", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case budgetAdjustmentPeriod = "BudgetAdjustmentPeriod"
            case lookBackAvailablePeriods = "LookBackAvailablePeriods"
        }
    }

    public struct IamActionDefinition: AWSEncodableShape & AWSDecodableShape {
        /// A list of groups to be attached. There must be at least one group.
        public let groups: [String]?
        /// The Amazon Resource Name (ARN) of the policy to be attached.
        public let policyArn: String
        /// A list of roles to be attached. There must be at least one role.
        public let roles: [String]?
        /// A list of users to be attached. There must be at least one user.
        public let users: [String]?

        @inlinable
        public init(groups: [String]? = nil, policyArn: String, roles: [String]? = nil, users: [String]? = nil) {
            self.groups = groups
            self.policyArn = policyArn
            self.roles = roles
            self.users = users
        }

        public func validate(name: String) throws {
            try self.groups?.forEach {
                try validate($0, name: "groups[]", parent: name, max: 640)
                try validate($0, name: "groups[]", parent: name, min: 1)
                try validate($0, name: "groups[]", parent: name, pattern: "^([\\u0021-\\u007F]+\\u002F)?[\\w+=,.@-]+$")
            }
            try self.validate(self.groups, name: "groups", parent: name, max: 100)
            try self.validate(self.groups, name: "groups", parent: name, min: 1)
            try self.validate(self.policyArn, name: "policyArn", parent: name, max: 684)
            try self.validate(self.policyArn, name: "policyArn", parent: name, min: 25)
            try self.validate(self.policyArn, name: "policyArn", parent: name, pattern: "^arn:aws(-cn|-us-gov|-iso|-iso-[a-z]{1})?:iam::(\\d{12}|aws):policy(\\u002F[\\u0021-\\u007F]+\\u002F|\\u002F)[\\w+=,.@-]+$")
            try self.roles?.forEach {
                try validate($0, name: "roles[]", parent: name, max: 576)
                try validate($0, name: "roles[]", parent: name, min: 1)
                try validate($0, name: "roles[]", parent: name, pattern: "^([\\u0021-\\u007F]+\\u002F)?[\\w+=,.@-]+$")
            }
            try self.validate(self.roles, name: "roles", parent: name, max: 100)
            try self.validate(self.roles, name: "roles", parent: name, min: 1)
            try self.users?.forEach {
                try validate($0, name: "users[]", parent: name, max: 576)
                try validate($0, name: "users[]", parent: name, min: 1)
                try validate($0, name: "users[]", parent: name, pattern: "^([\\u0021-\\u007F]+\\u002F)?[\\w+=,.@-]+$")
            }
            try self.validate(self.users, name: "users", parent: name, max: 100)
            try self.validate(self.users, name: "users", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case groups = "Groups"
            case policyArn = "PolicyArn"
            case roles = "Roles"
            case users = "Users"
        }
    }

    public struct ListTagsForResourceRequest: AWSEncodableShape {
        /// The unique identifier for the resource.
        public let resourceARN: String

        @inlinable
        public init(resourceARN: String) {
            self.resourceARN = resourceARN
        }

        public func validate(name: String) throws {
            try self.validate(self.resourceARN, name: "resourceARN", parent: name, max: 1011)
            try self.validate(self.resourceARN, name: "resourceARN", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case resourceARN = "ResourceARN"
        }
    }

    public struct ListTagsForResourceResponse: AWSDecodableShape {
        /// The tags associated with the resource.
        public let resourceTags: [ResourceTag]?

        @inlinable
        public init(resourceTags: [ResourceTag]? = nil) {
            self.resourceTags = resourceTags
        }

        private enum CodingKeys: String, CodingKey {
            case resourceTags = "ResourceTags"
        }
    }

    public struct Notification: AWSEncodableShape & AWSDecodableShape {
        /// The comparison that's used for this notification.
        public let comparisonOperator: ComparisonOperator
        /// Specifies whether this notification is in alarm. If a budget notification is in the
        /// 				ALARM state, you passed the set threshold for the budget.
        public let notificationState: NotificationState?
        /// Specifies whether the notification is for how much you have spent
        /// 			(ACTUAL) or for how much that you're forecasted to spend
        /// 				(FORECASTED).
        public let notificationType: NotificationType
        /// The threshold that's associated with a notification. Thresholds are always a
        /// 			percentage, and many customers find value being alerted between 50% - 200% of the
        /// 			budgeted amount. The maximum limit for your threshold is 1,000,000% above the budgeted
        /// 			amount.
        public let threshold: Double
        /// The type of threshold for a notification. For ABSOLUTE_VALUE thresholds,
        /// 				Amazon Web Services notifies you when you go over or are forecasted to go over your
        /// 			total cost threshold. For
        /// 				PERCENTAGE thresholds, Amazon Web Services notifies you when you go over
        /// 			or are forecasted to go over a certain percentage of your forecasted spend. For example,
        /// 			if you have a budget for 200 dollars and you have a PERCENTAGE threshold of
        /// 			80%, Amazon Web Services notifies you when you go over 160 dollars.
        public let thresholdType: ThresholdType?

        @inlinable
        public init(comparisonOperator: ComparisonOperator, notificationState: NotificationState? = nil, notificationType: NotificationType, threshold: Double, thresholdType: ThresholdType? = nil) {
            self.comparisonOperator = comparisonOperator
            self.notificationState = notificationState
            self.notificationType = notificationType
            self.threshold = threshold
            self.thresholdType = thresholdType
        }

        public func validate(name: String) throws {
            try self.validate(self.threshold, name: "threshold", parent: name, max: 15000000000000.0)
            try self.validate(self.threshold, name: "threshold", parent: name, min: 0.0)
        }

        private enum CodingKeys: String, CodingKey {
            case comparisonOperator = "ComparisonOperator"
            case notificationState = "NotificationState"
            case notificationType = "NotificationType"
            case threshold = "Threshold"
            case thresholdType = "ThresholdType"
        }
    }

    public struct NotificationWithSubscribers: AWSEncodableShape {
        /// The notification that's associated with a budget.
        public let notification: Notification
        /// A list of subscribers who are subscribed to this notification.
        public let subscribers: [Subscriber]

        @inlinable
        public init(notification: Notification, subscribers: [Subscriber]) {
            self.notification = notification
            self.subscribers = subscribers
        }

        public func validate(name: String) throws {
            try self.notification.validate(name: "\(name).notification")
            try self.subscribers.forEach {
                try $0.validate(name: "\(name).subscribers[]")
            }
            try self.validate(self.subscribers, name: "subscribers", parent: name, max: 11)
            try self.validate(self.subscribers, name: "subscribers", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case notification = "Notification"
            case subscribers = "Subscribers"
        }
    }

    public struct ResourceTag: AWSEncodableShape & AWSDecodableShape {
        /// The key that's associated with the tag.
        public let key: String
        /// The value that's associated with the tag.
        public let value: String

        @inlinable
        public init(key: String, value: String) {
            self.key = key
            self.value = value
        }

        public func validate(name: String) throws {
            try self.validate(self.key, name: "key", parent: name, max: 128)
            try self.validate(self.key, name: "key", parent: name, min: 1)
            try self.validate(self.value, name: "value", parent: name, max: 256)
        }

        private enum CodingKeys: String, CodingKey {
            case key = "Key"
            case value = "Value"
        }
    }

    public struct ScpActionDefinition: AWSEncodableShape & AWSDecodableShape {
        /// The policy ID attached.
        public let policyId: String
        /// A list of target IDs.
        public let targetIds: [String]

        @inlinable
        public init(policyId: String, targetIds: [String]) {
            self.policyId = policyId
            self.targetIds = targetIds
        }

        public func validate(name: String) throws {
            try self.validate(self.policyId, name: "policyId", parent: name, max: 130)
            try self.validate(self.policyId, name: "policyId", parent: name, min: 10)
            try self.validate(self.policyId, name: "policyId", parent: name, pattern: "^p-[0-9a-zA-Z_]{8,128}$")
            try self.targetIds.forEach {
                try validate($0, name: "targetIds[]", parent: name, max: 68)
                try validate($0, name: "targetIds[]", parent: name, min: 12)
                try validate($0, name: "targetIds[]", parent: name, pattern: "^(ou-[0-9a-z]{4,32}-[a-z0-9]{8,32}$)|(\\d{12})$")
            }
            try self.validate(self.targetIds, name: "targetIds", parent: name, max: 100)
            try self.validate(self.targetIds, name: "targetIds", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case policyId = "PolicyId"
            case targetIds = "TargetIds"
        }
    }

    public struct Spend: AWSEncodableShape & AWSDecodableShape {
        /// The cost or usage amount that's associated with a budget forecast, actual spend, or
        /// 			budget threshold.
        public let amount: String
        /// The unit of measurement that's used for the budget forecast, actual spend, or budget
        /// 			threshold.
        public let unit: String

        @inlinable
        public init(amount: String, unit: String) {
            self.amount = amount
            self.unit = unit
        }

        public func validate(name: String) throws {
            try self.validate(self.amount, name: "amount", parent: name, max: 2147483647)
            try self.validate(self.amount, name: "amount", parent: name, min: 1)
            try self.validate(self.amount, name: "amount", parent: name, pattern: "^([0-9]*\\.)?[0-9]+$")
            try self.validate(self.unit, name: "unit", parent: name, max: 2147483647)
            try self.validate(self.unit, name: "unit", parent: name, min: 1)
            try self.validate(self.unit, name: "unit", parent: name, pattern: ".*")
        }

        private enum CodingKeys: String, CodingKey {
            case amount = "Amount"
            case unit = "Unit"
        }
    }

    public struct SsmActionDefinition: AWSEncodableShape & AWSDecodableShape {
        /// The action subType.
        public let actionSubType: ActionSubType
        /// The EC2 and RDS instance IDs.
        public let instanceIds: [String]
        /// The Region to run the SSM document.
        public let region: String

        @inlinable
        public init(actionSubType: ActionSubType, instanceIds: [String], region: String) {
            self.actionSubType = actionSubType
            self.instanceIds = instanceIds
            self.region = region
        }

        public func validate(name: String) throws {
            try self.instanceIds.forEach {
                try validate($0, name: "instanceIds[]", parent: name, max: 63)
                try validate($0, name: "instanceIds[]", parent: name, min: 1)
                try validate($0, name: "instanceIds[]", parent: name, pattern: "^i-(\\w{8}|\\w{17})$|^[a-zA-Z]([\\w-]{0,61}\\w)?$")
            }
            try self.validate(self.instanceIds, name: "instanceIds", parent: name, max: 100)
            try self.validate(self.instanceIds, name: "instanceIds", parent: name, min: 1)
            try self.validate(self.region, name: "region", parent: name, max: 20)
            try self.validate(self.region, name: "region", parent: name, min: 9)
            try self.validate(self.region, name: "region", parent: name, pattern: "^\\w{2}-\\w+(-\\w+)?-\\d$")
        }

        private enum CodingKeys: String, CodingKey {
            case actionSubType = "ActionSubType"
            case instanceIds = "InstanceIds"
            case region = "Region"
        }
    }

    public struct Subscriber: AWSEncodableShape & AWSDecodableShape {
        /// The address that Amazon Web Services sends budget notifications to, either an SNS topic
        /// 			or an email. When you create a subscriber, the value of Address can't contain line
        /// 			breaks.
        public let address: String
        /// The type of notification that Amazon Web Services sends to a subscriber.
        public let subscriptionType: SubscriptionType

        @inlinable
        public init(address: String, subscriptionType: SubscriptionType) {
            self.address = address
            self.subscriptionType = subscriptionType
        }

        public func validate(name: String) throws {
            try self.validate(self.address, name: "address", parent: name, max: 2147483647)
            try self.validate(self.address, name: "address", parent: name, min: 1)
            try self.validate(self.address, name: "address", parent: name, pattern: "^(.*[\\n\\r\\t\\f\\ ]?)*$")
        }

        private enum CodingKeys: String, CodingKey {
            case address = "Address"
            case subscriptionType = "SubscriptionType"
        }
    }

    public struct TagResourceRequest: AWSEncodableShape {
        /// The unique identifier for the resource.
        public let resourceARN: String
        /// The tags associated with the resource.
        public let resourceTags: [ResourceTag]

        @inlinable
        public init(resourceARN: String, resourceTags: [ResourceTag]) {
            self.resourceARN = resourceARN
            self.resourceTags = resourceTags
        }

        public func validate(name: String) throws {
            try self.validate(self.resourceARN, name: "resourceARN", parent: name, max: 1011)
            try self.validate(self.resourceARN, name: "resourceARN", parent: name, min: 1)
            try self.resourceTags.forEach {
                try $0.validate(name: "\(name).resourceTags[]")
            }
            try self.validate(self.resourceTags, name: "resourceTags", parent: name, max: 200)
        }

        private enum CodingKeys: String, CodingKey {
            case resourceARN = "ResourceARN"
            case resourceTags = "ResourceTags"
        }
    }

    public struct TagResourceResponse: AWSDecodableShape {
        public init() {}
    }

    public struct TagValues: AWSEncodableShape & AWSDecodableShape {
        /// The key for the tag.
        public let key: String?
        /// The match options that you can use to filter your results.
        public let matchOptions: [MatchOption]?
        /// The specific value of the tag.
        public let values: [String]?

        @inlinable
        public init(key: String? = nil, matchOptions: [MatchOption]? = nil, values: [String]? = nil) {
            self.key = key
            self.matchOptions = matchOptions
            self.values = values
        }

        public func validate(name: String) throws {
            try self.validate(self.key, name: "key", parent: name, max: 1024)
            try self.validate(self.key, name: "key", parent: name, pattern: "^[\\S\\s]*$")
            try self.values?.forEach {
                try validate($0, name: "values[]", parent: name, max: 1024)
                try validate($0, name: "values[]", parent: name, pattern: "^[\\S\\s]*$")
            }
            try self.validate(self.values, name: "values", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case key = "Key"
            case matchOptions = "MatchOptions"
            case values = "Values"
        }
    }

    public struct TimePeriod: AWSEncodableShape & AWSDecodableShape {
        /// The end date for a budget. If you didn't specify an end date, Amazon Web Services set
        /// 			your end date to 06/15/87 00:00 UTC. The defaults are the same for the
        /// 				Billing and Cost Management console and the API. After the end date, Amazon Web Services deletes the budget and all the associated
        /// 			notifications and subscribers. You can change your end date with the
        /// 				UpdateBudget operation.
        public let end: Date?
        /// The start date for a budget. If you created your budget and didn't specify a start
        /// 			date, Amazon Web Services defaults to the start of your chosen time period (DAILY,
        /// 			MONTHLY, QUARTERLY, ANNUALLY, or CUSTOM). For example, if you created your budget on January 24,
        /// 			2018, chose DAILY, and didn't set a start date, Amazon Web Services set your
        /// 			start date to 01/24/18 00:00 UTC. If you chose MONTHLY,
        /// 				Amazon Web Services set your start date to 01/01/18 00:00 UTC. The
        /// 			defaults are the same for the Billing and Cost Management console and the API. You can change your start date with the UpdateBudget operation.
        public let start: Date?

        @inlinable
        public init(end: Date? = nil, start: Date? = nil) {
            self.end = end
            self.start = start
        }

        private enum CodingKeys: String, CodingKey {
            case end = "End"
            case start = "Start"
        }
    }

    public struct UntagResourceRequest: AWSEncodableShape {
        /// The unique identifier for the resource.
        public let resourceARN: String
        /// The key that's associated with the tag.
        public let resourceTagKeys: [String]

        @inlinable
        public init(resourceARN: String, resourceTagKeys: [String]) {
            self.resourceARN = resourceARN
            self.resourceTagKeys = resourceTagKeys
        }

        public func validate(name: String) throws {
            try self.validate(self.resourceARN, name: "resourceARN", parent: name, max: 1011)
            try self.validate(self.resourceARN, name: "resourceARN", parent: name, min: 1)
            try self.resourceTagKeys.forEach {
                try validate($0, name: "resourceTagKeys[]", parent: name, max: 128)
                try validate($0, name: "resourceTagKeys[]", parent: name, min: 1)
            }
            try self.validate(self.resourceTagKeys, name: "resourceTagKeys", parent: name, max: 200)
        }

        private enum CodingKeys: String, CodingKey {
            case resourceARN = "ResourceARN"
            case resourceTagKeys = "ResourceTagKeys"
        }
    }

    public struct UntagResourceResponse: AWSDecodableShape {
        public init() {}
    }

    public struct UpdateBudgetActionRequest: AWSEncodableShape {
        public let accountId: String
        ///  A system-generated universally unique identifier (UUID) for the action.
        public let actionId: String
        public let actionThreshold: ActionThreshold?
        ///  This specifies if the action needs manual or automatic approval.
        public let approvalModel: ApprovalModel?
        public let budgetName: String
        public let definition: Definition?
        ///  The role passed for action execution and reversion. Roles and actions must be in the same account.
        public let executionRoleArn: String?
        public let notificationType: NotificationType?
        public let subscribers: [Subscriber]?

        @inlinable
        public init(accountId: String, actionId: String, actionThreshold: ActionThreshold? = nil, approvalModel: ApprovalModel? = nil, budgetName: String, definition: Definition? = nil, executionRoleArn: String? = nil, notificationType: NotificationType? = nil, subscribers: [Subscriber]? = nil) {
            self.accountId = accountId
            self.actionId = actionId
            self.actionThreshold = actionThreshold
            self.approvalModel = approvalModel
            self.budgetName = budgetName
            self.definition = definition
            self.executionRoleArn = executionRoleArn
            self.notificationType = notificationType
            self.subscribers = subscribers
        }

        public func validate(name: String) throws {
            try self.validate(self.accountId, name: "accountId", parent: name, max: 12)
            try self.validate(self.accountId, name: "accountId", parent: name, min: 12)
            try self.validate(self.accountId, name: "accountId", parent: name, pattern: "^\\d{12}$")
            try self.validate(self.actionId, name: "actionId", parent: name, max: 36)
            try self.validate(self.actionId, name: "actionId", parent: name, min: 36)
            try self.validate(self.actionId, name: "actionId", parent: name, pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$")
            try self.actionThreshold?.validate(name: "\(name).actionThreshold")
            try self.validate(self.budgetName, name: "budgetName", parent: name, max: 100)
            try self.validate(self.budgetName, name: "budgetName", parent: name, min: 1)
            try self.validate(self.budgetName, name: "budgetName", parent: name, pattern: "^(?![^:\\\\]*/action/|(?i).*<script>.*</script>.*)[^:\\\\]+$")
            try self.definition?.validate(name: "\(name).definition")
            try self.validate(self.executionRoleArn, name: "executionRoleArn", parent: name, max: 618)
            try self.validate(self.executionRoleArn, name: "executionRoleArn", parent: name, min: 32)
            try self.validate(self.executionRoleArn, name: "executionRoleArn", parent: name, pattern: "^arn:aws(-cn|-us-gov|-iso|-iso-[a-z]{1})?:iam::\\d{12}:role(\\u002F[\\u0021-\\u007F]+\\u002F|\\u002F)[\\w+=,.@-]+$")
            try self.subscribers?.forEach {
                try $0.validate(name: "\(name).subscribers[]")
            }
            try self.validate(self.subscribers, name: "subscribers", parent: name, max: 11)
            try self.validate(self.subscribers, name: "subscribers", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case accountId = "AccountId"
            case actionId = "ActionId"
            case actionThreshold = "ActionThreshold"
            case approvalModel = "ApprovalModel"
            case budgetName = "BudgetName"
            case definition = "Definition"
            case executionRoleArn = "ExecutionRoleArn"
            case notificationType = "NotificationType"
            case subscribers = "Subscribers"
        }
    }

    public struct UpdateBudgetActionResponse: AWSDecodableShape {
        public let accountId: String
        public let budgetName: String
        ///  The updated action resource information.
        public let newAction: Action
        ///  The previous action resource information.
        public let oldAction: Action

        @inlinable
        public init(accountId: String, budgetName: String, newAction: Action, oldAction: Action) {
            self.accountId = accountId
            self.budgetName = budgetName
            self.newAction = newAction
            self.oldAction = oldAction
        }

        private enum CodingKeys: String, CodingKey {
            case accountId = "AccountId"
            case budgetName = "BudgetName"
            case newAction = "NewAction"
            case oldAction = "OldAction"
        }
    }

    public struct UpdateBudgetRequest: AWSEncodableShape {
        /// The accountId that is associated with the budget that you want to update.
        public let accountId: String
        /// The budget that you want to update your budget to.
        public let newBudget: Budget

        @inlinable
        public init(accountId: String, newBudget: Budget) {
            self.accountId = accountId
            self.newBudget = newBudget
        }

        public func validate(name: String) throws {
            try self.validate(self.accountId, name: "accountId", parent: name, max: 12)
            try self.validate(self.accountId, name: "accountId", parent: name, min: 12)
            try self.validate(self.accountId, name: "accountId", parent: name, pattern: "^\\d{12}$")
            try self.newBudget.validate(name: "\(name).newBudget")
        }

        private enum CodingKeys: String, CodingKey {
            case accountId = "AccountId"
            case newBudget = "NewBudget"
        }
    }

    public struct UpdateBudgetResponse: AWSDecodableShape {
        public init() {}
    }

    public struct UpdateNotificationRequest: AWSEncodableShape {
        /// The accountId that is associated with the budget whose notification you want to update.
        public let accountId: String
        /// The name of the budget whose notification you want to update.
        public let budgetName: String
        /// The updated notification to be associated with a budget.
        public let newNotification: Notification
        /// The previous notification that is associated with a budget.
        public let oldNotification: Notification

        @inlinable
        public init(accountId: String, budgetName: String, newNotification: Notification, oldNotification: Notification) {
            self.accountId = accountId
            self.budgetName = budgetName
            self.newNotification = newNotification
            self.oldNotification = oldNotification
        }

        public func validate(name: String) throws {
            try self.validate(self.accountId, name: "accountId", parent: name, max: 12)
            try self.validate(self.accountId, name: "accountId", parent: name, min: 12)
            try self.validate(self.accountId, name: "accountId", parent: name, pattern: "^\\d{12}$")
            try self.validate(self.budgetName, name: "budgetName", parent: name, max: 100)
            try self.validate(self.budgetName, name: "budgetName", parent: name, min: 1)
            try self.validate(self.budgetName, name: "budgetName", parent: name, pattern: "^(?![^:\\\\]*/action/|(?i).*<script>.*</script>.*)[^:\\\\]+$")
            try self.newNotification.validate(name: "\(name).newNotification")
            try self.oldNotification.validate(name: "\(name).oldNotification")
        }

        private enum CodingKeys: String, CodingKey {
            case accountId = "AccountId"
            case budgetName = "BudgetName"
            case newNotification = "NewNotification"
            case oldNotification = "OldNotification"
        }
    }

    public struct UpdateNotificationResponse: AWSDecodableShape {
        public init() {}
    }

    public struct UpdateSubscriberRequest: AWSEncodableShape {
        /// The accountId that is associated with the budget whose subscriber you want to update.
        public let accountId: String
        /// The name of the budget whose subscriber you want to update.
        public let budgetName: String
        /// The updated subscriber that is associated with a budget notification.
        public let newSubscriber: Subscriber
        /// The notification whose subscriber you want to update.
        public let notification: Notification
        /// The previous subscriber that is associated with a budget notification.
        public let oldSubscriber: Subscriber

        @inlinable
        public init(accountId: String, budgetName: String, newSubscriber: Subscriber, notification: Notification, oldSubscriber: Subscriber) {
            self.accountId = accountId
            self.budgetName = budgetName
            self.newSubscriber = newSubscriber
            self.notification = notification
            self.oldSubscriber = oldSubscriber
        }

        public func validate(name: String) throws {
            try self.validate(self.accountId, name: "accountId", parent: name, max: 12)
            try self.validate(self.accountId, name: "accountId", parent: name, min: 12)
            try self.validate(self.accountId, name: "accountId", parent: name, pattern: "^\\d{12}$")
            try self.validate(self.budgetName, name: "budgetName", parent: name, max: 100)
            try self.validate(self.budgetName, name: "budgetName", parent: name, min: 1)
            try self.validate(self.budgetName, name: "budgetName", parent: name, pattern: "^(?![^:\\\\]*/action/|(?i).*<script>.*</script>.*)[^:\\\\]+$")
            try self.newSubscriber.validate(name: "\(name).newSubscriber")
            try self.notification.validate(name: "\(name).notification")
            try self.oldSubscriber.validate(name: "\(name).oldSubscriber")
        }

        private enum CodingKeys: String, CodingKey {
            case accountId = "AccountId"
            case budgetName = "BudgetName"
            case newSubscriber = "NewSubscriber"
            case notification = "Notification"
            case oldSubscriber = "OldSubscriber"
        }
    }

    public struct UpdateSubscriberResponse: AWSDecodableShape {
        public init() {}
    }
}

// MARK: - Errors

/// Error enum for Budgets
public struct BudgetsErrorType: AWSErrorType {
    enum Code: String {
        case accessDeniedException = "AccessDeniedException"
        case billingViewHealthStatusException = "BillingViewHealthStatusException"
        case creationLimitExceededException = "CreationLimitExceededException"
        case duplicateRecordException = "DuplicateRecordException"
        case expiredNextTokenException = "ExpiredNextTokenException"
        case internalErrorException = "InternalErrorException"
        case invalidNextTokenException = "InvalidNextTokenException"
        case invalidParameterException = "InvalidParameterException"
        case notFoundException = "NotFoundException"
        case resourceLockedException = "ResourceLockedException"
        case serviceQuotaExceededException = "ServiceQuotaExceededException"
        case throttlingException = "ThrottlingException"
    }

    private let error: Code
    public let context: AWSErrorContext?

    /// initialize Budgets
    public init?(errorCode: String, context: AWSErrorContext) {
        guard let error = Code(rawValue: errorCode) else { return nil }
        self.error = error
        self.context = context
    }

    internal init(_ error: Code) {
        self.error = error
        self.context = nil
    }

    /// return error code string
    public var errorCode: String { self.error.rawValue }

    /// You are not authorized to use this operation with the given parameters.
    public static var accessDeniedException: Self { .init(.accessDeniedException) }
    ///  The billing view status must be HEALTHY to perform this action. Try again when the status is HEALTHY.
    public static var billingViewHealthStatusException: Self { .init(.billingViewHealthStatusException) }
    /// You've exceeded the notification or subscriber limit.
    public static var creationLimitExceededException: Self { .init(.creationLimitExceededException) }
    /// The budget name already exists. Budget names must be unique within an account.
    public static var duplicateRecordException: Self { .init(.duplicateRecordException) }
    /// The pagination token expired.
    public static var expiredNextTokenException: Self { .init(.expiredNextTokenException) }
    /// An error on the server occurred during the processing of your request. Try again later.
    public static var internalErrorException: Self { .init(.internalErrorException) }
    /// The pagination token is invalid.
    public static var invalidNextTokenException: Self { .init(.invalidNextTokenException) }
    /// An error on the client occurred. Typically, the cause is an invalid input value.
    public static var invalidParameterException: Self { .init(.invalidParameterException) }
    /// We can’t locate the resource that you specified.
    public static var notFoundException: Self { .init(.notFoundException) }
    /// The request was received and recognized by the server, but the server rejected that particular method for the requested resource.
    public static var resourceLockedException: Self { .init(.resourceLockedException) }
    /// You've reached the limit on the number of tags you can associate with a resource.
    public static var serviceQuotaExceededException: Self { .init(.serviceQuotaExceededException) }
    /// The number of API requests has exceeded the maximum allowed API request throttling limit for the account.
    public static var throttlingException: Self { .init(.throttlingException) }
}

extension BudgetsErrorType: Equatable {
    public static func == (lhs: BudgetsErrorType, rhs: BudgetsErrorType) -> Bool {
        lhs.error == rhs.error
    }
}

extension BudgetsErrorType: CustomStringConvertible {
    public var description: String {
        return "\(self.error.rawValue): \(self.message ?? "")"
    }
}
